<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="radio" name="sex" value="0" title="男" >男
		<input type="radio" name="sex" value="1" title="女" checked >女
		<button type="button" onclick="getRadio()">获取</button>
	</body>
	<script type="text/javascript">
		function getRadio(){
			var rd=document.getElementsByName("sex");
			for(var i=0;i<rd.length;i++){
				if(rd[i].checked){
					console.log(rd[i].textContent);
				}
			}
		}
	</script>
</html>
